package com.anli.web;

import com.anli.entity.StockInfo;
import com.anli.service.TestLockService;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @author: LI-CI-GAO
 * 作者: licigao
 * 日期: 2021/8/30  11:43
 * 描述:
 */
@RestController
public class TestRedisLock {


    @Autowired
    private TestLockService testLockService;


    @RequestMapping("testLock")
    public String tttt(){

        StockInfo stockInfo=new StockInfo();
        stockInfo.setStock(1L);
        stockInfo.setGoodsId(100L);
        stockInfo.setStockId(2L);

        //testLockService.testLock(stockInfo);
        testLockService.leGUanSuo(stockInfo);

        return "ok";
    }








}
